//
// Created by vcq on 21/2/9.
//
#pragma once
#ifndef SYLLABUS_API_USER_HPP
#define SYLLABUS_API_USER_HPP

#include "model/user.hpp"
using namespace nlohmann;
static void GetAllUser(request& req, response& res) {
    auto session = req.get_session().lock();
    if (session == nullptr || session->get_data<std::string>("user_name").empty()) {
        auto new_session = res.start_session();
        new_session->set_max_age(-1);
    }
    json ret = mgetAllUser();
    res.set_status_and_content(status_type::ok, ret.dump(),req_content_type::json);
}
#endif //SYLLABUS_API_USER_HPP